<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增订单')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单发起公司：</label>
                <div class="col-sm-8">
                    <p class="form-control" th:if="${user.getDeptId() == 301}" th:text="中国石化仪征化纤股份有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 301}" th:text="中国石化仪征化纤股份有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 302}" th:text="库车益泰棉业有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 303}" th:text="鲁泰纺织有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 304}" th:text="重庆三五三三印染服装"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 305}" th:text="广州帝豪服装有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 306}" th:text="雅兰迪服饰商贸有限公司"></p>
                    <p class="form-control" th:if="${user.getDeptId() == 307}" th:text="中国李宁有限公司"></p>
                    <input name="sysDept1" class="form-control" type="hidden" th:value="${user.getDeptId()}">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单接受公司：</label>
                <div class="col-sm-8">
                    <p class="form-control" th:if="${good.getCom() == 301}" th:text="中国石化仪征化纤股份有限公司"></p>
                    <p class="form-control" th:if="${good.getCom() == 302}" th:text="库车益泰棉业有限公司"></p>
                    <p class="form-control" th:if="${good.getCom() == 303}" th:text="鲁泰纺织有限公司"></p>
                    <p class="form-control" th:if="${good.getCom() == 304}" th:text="重庆三五三三印染服装"></p>
                    <p class="form-control" th:if="${good.getCom() == 305}" th:text="广州帝豪服装有限公司"></p>
                    <p class="form-control" th:if="${good.getCom() == 306}" th:text="雅兰迪服饰商贸有限公司"></p>
                    <p class="form-control" th:if="${good.getCom() == 307}" th:text="中国李宁有限公司"></p>
                    <input id="com_id" name="sysDept2" type="hidden" th:value="${good.getCom()}">
                </div>
            </div>
            <script>


            </script>
            <div class="form-group">    
                <label class="col-sm-3 control-label">货物：</label>
                <div class="col-sm-8">
                    <p class="form-control" th:text="${good.getName()}"></p>
                    <input name="goodsId" type="hidden" th:value="${good.getId()}">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="goodsNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">单价：</label>
                <div class="col-sm-8">
                    <input name="goodsPrice" class="form-control" type="text" th:value="${good.getPrice()}">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/order"
        $("#form-order-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-order-add').serialize());
            }
        }
    </script>
</body>
</html>